	function validateForm(){
			var message = "";
			var errMessages = [];
			errMessages.push(validateField("id", ["empty"]));
			errMessages.push(validateField("pw1", ["empty"]));
			errMessages.push(validateField("pw2", ["empty"]));
			errMessages.push(validateField("email", ["empty","email"]));
			if($("#pw1").val() !== $("#pw2").val()){
				errMessages.push("\n-The passwords don't match.");
			}
			for(var i = 0; i<errMessages.length; i++){
				message += errMessages[i];
			}
			var errorDisplayer = $("#regFormErrors");
			if(message.trim() !== ""){
				errorDisplayer.html(message);
				return false;
			}
			else
			{
				errorDisplayer.html("");
				return true;
			}
	}
	function initializeRegisterForm(){
		debugger;
		var doRegister = function(){
			if(validateForm())
			{
				showLoadingLayer();
				var processRegistrationResponse = function(r){
					hideLoadingLayer();
					r = JSON.parse(r);
					if(!r){
						alert("There has been an error. Please try again later.");
						return;
					}
					if(!r.error)
					{
						hideLoginLayer();
					}
					alert(r.response);
				};
				var url = getURL("accountValidator.php");
				var params = {
					id : $("#id").val(),
					pw : $("#pw1").val(),
					email : $("#email").val(),
					action: "register"
				};
				debugger;
				$.post(url, params ,processRegistrationResponse);
			}
		};
		$("#regForm #submitRegistrationButton").on("click", doRegister);
		$("#regForm input:not([type='submit'],[type='hidden'])").each(function(){
			var input = $(this);
			var validateOnChange = function(){
				var submitButton = $("#regForm #submitRegistrationButton");
				var classToRemove = "";
				var classToAdd = "";
				if(!validateForm())
				{
					classToAdd = "inputSubmitInactive";
					classToRemove = "inputSubmitActiavated";
				}
				else
				{
					classToAdd = "inputSubmitActiavated";
					classToRemove = "inputSubmitInactive";
				}
				submitButton.removeClass(classToRemove).addClass(classToAdd);
			};
			input.on("change", validateOnChange);
		});
		$("#backToLogin").on("click", function(){
			$("#loginButton").trigger("click");
		});
	}